import Enum from "./BaseEnums"

/**
 * 用户类型枚举
 */
class UserType extends Enum {
    static USER_SYSTEM_ADMIN = ["USER_SYSTEM_ADMIN", "系统管理员"];
    static USER_SYSTEM_USER = ["USER_SYSTEM_USER", "系统用户"];
    static USER_TENANT_ADMIN = ["USER_TENANT_ADMIN", "租户管理员"];
    static USER_TENANT_USER = ["USER_TENANT_USER", "租户用户"];

    static code;
    static desc;

    getDesc(key) {
        let userType = new UserType();
        switch (key) {
            case "USER_SYSTEM_ADMIN":
                return userType.USER_SYSTEM_ADMIN.desc;
            case "USER_SYSTEM_USER":
                return userType.USER_SYSTEM_USER.desc;
            case "USER_TENANT_ADMIN":
                return userType.USER_TENANT_ADMIN.desc;
            case "USER_TENANT_USER":
                return userType.USER_TENANT_USER.desc;
            default:
                return "未知类型";
        }
    }
}
export const userType = new UserType();

/**
 * 用户状态枚举
 */
class UserStatus extends Enum{
    static ACCOUNT_NORMAL = ["ACCOUNT_NORMAL", "正常"];
    static ACCOUNT_EXPIRATION = ["ACCOUNT_EXPIRATION", "过期"];
    static ACCOUNT_STOP = ["ACCOUNT_STOP", "停止"];

    static code;
    static desc;

    getDesc(key) {
        let userstatus = new UserStatus();
        switch (key) {
            case "ACCOUNT_NORMAL":
                return userstatus.ACCOUNT_NORMAL.desc;
            case "ACCOUNT_EXPIRATION":
                return userstatus.ACCOUNT_EXPIRATION.desc;
            case "ACCOUNT_STOP":
                return userstatus.ACCOUNT_STOP.desc;
            default:
                return "未知类型";
        }
    }
}
export const userstatus = new UserStatus();

